<template>
  <div class="container">
    <Recorder @audio-available="handleAudioAvailable" />
  </div>
</template>

<script setup>
import Recorder from './components/Recorder.vue';
import { audio2text } from './api';

const handleAudioAvailable = (audioData) => {
  console.log('收到的音频数据:', audioData);
  const formData = new FormData();
  formData.append('file', audioData.blob, 'audio.mp3');
  // audio2text(formData).then(res => {
  //   console.log('识别到的文本:', res);
  // });
};
</script>

<style>
.container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>